<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <!-- 插入vue -->
    <script src="../code/js/vue2.js"></script>
</head>
<body>
  <div id="app">
    <h1>{{name}} </h1>
    <!-- 动态生成 -->
    <img :src="img" alt=""> 
    <!-- <img src="" alt="">    -->
  </div> 
     
</body>
</html>
 <!-- 构造函数 -->
<script>
    var vm = new Vue({
        el:'#app',
        data:{
           name:'jack',
           img:'./images/avatar.jpg' //img是一个变量
        }
    })  
 
</script>